package com.xiaoxi.bms.service.user;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xiaoxi.bms.common.exception.BMSException;
import com.xiaoxi.bms.domain.user.BMSUserDetail;
import com.xiaoxi.bms.domain.user.dto.BMSUserDetailDTO;
import com.xiaoxi.bms.domain.user.vo.BMSUserDetailVO;
import org.springframework.data.domain.Pageable;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author xiaoxi
 * @version 1.0
 * @date 2022/6/22 23:10
 */
public interface BMSUserDetailService extends IService<BMSUserDetail> {

    /**
     * 获取所有 用户列表
     *
     * @param bmsUserDetailDTO 查询条件
     * @param pageable         分页
     * @return
     */
    IPage<BMSUserDetailVO> getAllUserInfo(BMSUserDetailDTO bmsUserDetailDTO, Pageable pageable);

    /**
     * 通过 user 详情 编号 查询单个用户信息
     *
     * @param userDetailId
     * @return
     */
    BMSUserDetailVO getUserInfoByUserDetailId(Long userDetailId) throws BMSException;

    /**
     * 更新 user 内容
     *
     * @param bmsUserDetailVO
     */
    void updateUserInfo(BMSUserDetailVO bmsUserDetailVO) throws BMSException;

    /**
     * 创建 user
     *
     * @param bmsUserDetailVO
     */
    void createUserInfo(BMSUserDetailVO bmsUserDetailVO) throws BMSException;

    /**
     * 获取当前用户信息
     *
     * @return
     */
    BMSUserDetailVO getCurrentUserInfo() throws BMSException;

    /**
     * 编辑当前用户
     *
     * @param bmsUserDetailVO
     * @return
     */
    BMSUserDetail editCurrentUserInfo(BMSUserDetailVO bmsUserDetailVO) throws BMSException;

    /**
     * 通过 userId 获取用户信息
     *
     * @param userId
     * @return
     */
    BMSUserDetail getUserInfoByUserId(Long userId);


    /**
     * 通过 userId 修改最后登录时间
     * @param userId
     */
    void updateLastLoginTime(Long userId);

}
